package main

import "fmt"

func main() {
	//数组截取切片
	arr := [10]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
	fmt.Println(arr)

	//4-9
	s1 := arr[3:9]
	fmt.Println(s1)

	s2 := arr[:9]
	fmt.Println(s2)

	fmt.Println("——————————————————————————————") //copy

	s3 := []int{1, 2, 3, 4, 5, 5555}
	s4 := make([]int, 0)
	for i := 0; i < len(s3); i++ {
		s4 = append(s4, s3[i])
	}
	fmt.Println(s4)
	s5 := []int{6, 7, 8, 9, 10}
	copy(s4, s5)
	fmt.Println(s3, s4, s5)
}
